<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<%@ include file="/module/js.jsp"%>
<%@ include file="/module/orderField.jsp"%>
<script type="text/javascript" src="${basePath}/js/jquery.Huploadify.js"></script>
<link href="${basePath}/css/Huploadify.css" rel="stylesheet">
	<style>
table label.error {
	margin-left: 5px;
	width: auto;
	display: inline;
	color: red;
}
</style>
<script>
$(document).ready(
					function() {
						$("#div1").dialog({
							width : 'auto',
							height : 'auto',
							bgiframe : true,
							modal : true,
							draggable : true,
							resizable : false,
							title : '选择负责人',
							autoOpen : false,
						    buttons : {
						    '取消' : function() {
						    	$(this).dialog('close');
							},
							'确定' : function() {
							  
							  if($("#fromSelect").val()==null||$("#fromSelect").val()==""){
								 alert("请选择一项");
								 return false;
							  }else{
								    var formSelect = document.getElementById("fromSelect");
								    var str = [];
								    var num=0;
								    for(i=0;i<formSelect.length;i++){
								        if(formSelect.options[i].selected){
								            //str.push(select[i].value);
								            num++;
								        }
								    }
								    if(num>=2){
								      layer.alert("只能选择一项", {icon: 6});
								      return false;
								    }
								  
								  var str=$("#fromSelect").val()+"";
								  var strs = str.split(","); 
								  for(i=0;i<strs.length;i++){
									  if(i==0){
										  $("#dbempid").val(strs[i]);
                                      }
									  if(i==1){
										  $("#dbzgh").val(strs[i]);  
									  }
								  }
								
								  $("#gH").val("");
									$("#sFZH").val("");
									$("#mZ").val("");
									$("#xB").val("");
									$("#cSRQ").val("");
									$("#jG").val("");
									$("#jTDZ").val("");
									$("#lXDH").val("");
									$("#dZBMC").val("");
									$("#zBID").val("");
									$("#dYID").val("");
								  $("#xM").val($("#fromSelect").find("option:selected").text()); 
							     var dyid = $("#fromSelect").find("option:selected").val();
							    $.ajax({
										type:"post",//请求到服务器的方式，此处为POST方法
										url:"${basePath}/df/getDyinfo",//请求的服务器地址，此处调用json3方法
										data:{"dyid":dyid},
										success:function(data){//data为返回给客户端的JSON数据，存储在data这个变量里面
										/* 	$("#xM").val(data.xM); */
											$("#gH").val(data.gH);
											$("#sFZH").val(data.sFZH);
											$("#mZ").val(data.mZ);
											$("#xB").val(data.xB);
											$("#cSRQ").val(data.cSRQ);
											$("#jG").val(data.jG);
											$("#jTDZ").val(data.jTDZ);
											$("#lXDH").val(data.lXDH);
											$("#dZBMC").val(data.partyBranch.dZBMC);
											$("#zBID").val(data.partyBranch.zBID);
											alert(data.dYID);
											$("#dYID").val(data.dYID);
											if(data.isStu == '1') {
												$("#isStu").val('是');		
											} else if(data.isStu == '0') {
												$("#isStu").val('否');
											}
											if(data.dYLB == '1') {
												$("#dYLB").val('正式党员');	
											} else if(data.dYLB == '2') {
												$("#dYLB").val('预备党员');
											}
											if(data.dJZT == '1') {
												$("#dJZT").val('正常');	
											} else if(data.dJZT == '0') {
												$("#dJZT").val('停止党籍');
											}
										    $("#wHCD").val(data.wHCD);
										}
									
									}); 
								  
								  
								  
								  $(this).dialog('close');
							  }	  
							  /* var mycars=$("#fromSelect").val();
							  var g= mycars.toString();
							  alert(g);
							  var strArry = mycars.split(',');
							  if(strArry.length>1){
								  alert("负责人只能选择一个");  
								  return false;
							  } */
							}
						  }
						});

					});
	function showdiv() {
		$('#div1').dialog('open');
	}
</script>
</head>
<body>
	<form action="#" name="Form" id="Form" method="post">
		 <input type="hidden" name="dFID" id="dFID" value="${partyMembershipDues.dFID}" />
		 <input type="hidden" name="dYID" id="dYID" value="${partyLeagueMember.dYID}"/>
		<table cellpadding="0" cellspacing="0" border="0" class="table-border"
			width="95%">
			<tr>
				<td class="table-header" colspan="4">党费管理</td>
			</tr>
			<tr>
			    <td class="table-titleTD" style="width: 15%"><font style="color: red;">*</font>姓名:</td>
			     <td class="table-contentTD" style="width: 35%">
				  <input
					type="text" id="xM" name="xM" value="${partyLeagueMember.xM}" maxlength="100"  placeholder="姓名" class="inputText required" readonly="readonly"/>&nbsp&nbsp;
					<!-- <input type="button" id="optionBtn" value="选择" class="inputButton" 
					onclick="javascript:showdiv();" placeholder="请选择姓名"/> -->
			    </td>
			     <td class="table-titleTD" style="width: 15%"><font style="color: red;">*</font>性别:</td>
			     <td class="table-contentTD" style="width: 35%">
			        <input type="text" id="xB" name="xB" value="${partyLeagueMember.xB }" placeholder="性别"  maxlength="100" readonly="readonly" class="inputText required"/>
				</td>	
			</tr>
			<tr>
			     <td class="table-titleTD" style="width: 15%">
					所在党支部:
				</td>
				<td class="table-contentTD" style="width: 35%">
				 <input type="text" id="dZBMC" name="dZBMC" class="inputText"  value="${partyLeagueMember.partyBranch.dZBMC }" placeholder="所在党支部"  maxlength="100" readonly="readonly"/>
				</td>
			     <td class="table-titleTD" style="width: 15%">工号:</td>
			     <td class="table-contentTD" style="width: 35%">
				  <input type="text" id="gH" name="gH" placeholder="工号"  value="${partyLeagueMember.gH }" class="inputText" maxlength="100" readonly="readonly"/>
			    </td>	
			</tr>
			 <tr>
				<td class="table-titleTD" style="width: 15%">
					党员类别:
				</td>
				<td class="table-contentTD" style="width: 35%">
				 <input type="text" id="dYLB" name="dYLB" placeholder="党员类别" value="${partyLeagueMember.dYLB }"  class="inputText" maxlength="100" readonly="readonly" />
				</td>
				 <td class="table-titleTD" style="width: 15%">党籍状态:</td>
				<td class="table-contentTD" style="width: 35%">
				 <input type="text" id="dJZT" name="dJZT" placeholder="党籍状态" value="${partyLeagueMember.dJZT }" class="inputText" maxlength="100" readonly="readonly"/>
				</td>
			</tr>
			<tr>
			      <td class="table-titleTD" style="width: 15%">学生党员:</td>
				<td class="table-contentTD" style="width: 35%">
				    <input type="text" id="isStu" name="isStu" placeholder="学生党员" value="${partyLeagueMember.isStu }" class="inputText" maxlength="100" readonly="readonly"/>
				</td>	 
				 <td class="table-titleTD" style="width: 15%">学历:</td>
			     <td class="table-contentTD" style="width: 35%">
			      <input type="text" id="wHCD" name="wHCD" placeholder="学历"  value="${partyLeagueMember.wHCD }" class="inputText" maxlength="100" readonly="readonly"/>
			    </td>		
			</tr>
		    <tr>
			    <td class="table-titleTD" style="width: 15%">身份证号:</td>
			     <td class="table-contentTD"  style="width: 35%">
				   <input type="text" id="sFZH" name="sFZH" placeholder="身份证号"  value="${partyLeagueMember.sFZH }"  maxlength="100" class="inputText" readonly="readonly"/>
			    </td>	
			    <td class="table-titleTD" style="width: 15%">
			    <font style="color: red;">*</font>出生日期:
			    </td>
			    <td class="table-contentTD" style="width: 35%">
			    <input type="text" id="cSRQ" name="cSRQ" placeholder="出生日期"  
			    value="${partyLeagueMember.cSRQ}"
			    maxlength="100" class="inputText required" readonly="readonly"/>
			    </td>	
			  	
			</tr>
			<tr>
			     <td class="table-titleTD" style="width: 15%">民族:</td>
			     <td class="table-contentTD" style="width: 35%">
			     <input type="text" id="mZ" name="mZ" placeholder="民族" value="${partyLeagueMember.mZ }"  maxlength="100" class="inputText" readonly="readonly"/>
			    </td>	 
			     <td class="table-titleTD" style="width: 15%">籍贯:</td>
			     <td class="table-contentTD" style="width: 35%">
				  <input type="text" id="jG" name="jG" placeholder="籍贯"  value="${partyLeagueMember.jG }" class="inputText" maxlength="100" readonly="readonly"/>
			    </td>	
			</tr>
			<tr> 
			   <td class="table-titleTD" style="width: 15%"><font style="color: red;">*</font>年份:</td>
			     <td class="table-contentTD"  style="width: 35%">
				   <input name="dFNF" id="dFNF" placeholder="年份" autocomplete="off"  value="${partyMembershipDues.dFNF }"
					   class="inputText required" style="width: 70%"
					   onFocus="WdatePicker({dateFmt:'yyyy'})"/>
			    </td>	
			    <td class="table-titleTD" style="width: 15%"><font style="color: red;">*</font>月份:</td>
			     <td class="table-contentTD"  style="width: 35%">
				   <input name="dFYF" id="dFYF" placeholder="月份" autocomplete="off" value="${partyMembershipDues.dFYF }"
					   class="inputText required" style="width: 70%"
					   onFocus="WdatePicker({dateFmt:'MM'})"/>
			    </td>
			</tr>
			<tr>
			      <td class="table-titleTD" style="width: 15%">党费:</td>
			    <td class="table-contentTD" style="width: 35%">
				   <input type="text" id="dFJE" name="dFJE" placeholder="党费"  value="${partyMembershipDues.dFJE }"  maxlength="100" class="inputText"/>
			    </td>	
			</tr>
				<tr>
			    <td class="table-titleTD" style="width: 15%">家庭住址:</td>
			     <td class="table-contentTD" style="width: 35%">
				  <input type="text" id="jTDZ" name="jTDZ" placeholder="家庭住址"  ${partyLeagueMember.jTDZ }  maxlength="100" readonly="readonly" class="inputText"/>
			    </td>	
			    <td class="table-titleTD" style="width: 15%">联系电话:</td>
			     <td class="table-contentTD" style="width: 35%">
				  <input type="text" id="lXDH" name="lXDH" placeholder="联系电话" ${partyLeagueMember.lXDH }  maxlength="100" readonly="readonly" class="inputText"/>
			    </td>		
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 15%">备注:</td>
				<td class="table-contentTD" colspan="3" style="width: 35%">
				 <textarea rows="5" cols="50" name="remark" id="remark"  value=""  class="inputText" placeholder="备注"  maxlength="2000" >${partyMembershipDues.remark }</textarea>
			    </td>
			</tr> 
		        </table>
		<br />
		<table cellpadding="1" cellspacing="1" border="0" align="left">
			<c:if test="${_login_user_type==2}">
			<tr>
				<td>
				<kl:permission permisstionList="${permisstionList}"
               currentUser="${_login_console_user}"
               currentCatalogId="<%=CatalogUtils.getCatalogId(\"ZHDJ_GRDJ_DFGL\")%>" key="modify">
				<input type="button" id="btnSave" class="inputButton"
					style="text-align: center;" value="保存" />
				</kl:permission>
				</td>
				<td>
				<kl:permission permisstionList="${permisstionList}"
               currentUser="${_login_console_user}"
               currentCatalogId="<%=CatalogUtils.getCatalogId(\"ZHDJ_GRDJ_DFGL\")%>" key="modify">
				<input type="button" id="btnSaveContinue" class="inputButton"
					style="text-align: center;" value="保存并新增" />
				</kl:permission>
				</td>
				<td><input type="button" id="Cancel" class="inputButton"
					style="text-align: center;" value="取消" /></td>
				<td><input type="button" id="returnBut" class="inputButton"
					value="返回" style="text-align: center;" /></td>
			</tr>
		</c:if>
		</table>
	</form>

	<script>
			$(document).ready(function() {
				var _form=$("#Form").validate();
				/* 保存  */
				$("#btnSave").click(function() {
					if(_form.form()){
						validataSave();
					}
				});
				/* 保存并新增  */
				$("#btnSaveContinue").click(function() {
					if(_form.form()){
						  validataSaveContinue();
					}
				});
				function validataSave(){
				   	/* $.ajax({
						  type: 'POST',
						  url: "${basePath}/dzb/validation",
					      data:{dZBMC : $('#xmmc').val(),dbxm: $('dbxm').val(),wyxm: $('wyxm').val()},
						  success:function(data){
							if(isEmpty($('#xmmc').val())){
								$('').val("这一项必须填写");
								return false;
							}else if(isEmpty(data.dzbmc)){
							     layer.alert('党支部名称已存在', {icon: 5});
							     return false;
						   }else if(isEmpty(data.dzbsjmc)){
							     layer.alert('申请人名称已经存在请重新输入', {icon: 5});
							     return false;
						   }else if(isEmpty(data.dzbwy)){
							     layer.alert('申请人名称已经存在请重新输入', {icon: 5});
							     return false;
 						   
						   }else{   */
						   /*  var vals =  $('#wyxm').combobox('getValues');
						    $("#wyxm_id").val(vals); */
						    document.Form.action ="${basePath}/df/update?action=1";
							document.Form.submit();
						/*       }   
						  }
						});   */
				}
				function validataSaveContinue(){
				  /* 	$.ajax({
						  type: 'POST',
						  url: "${basePath}/twglStudentCadre/validation",
					      data:{xmmc : $('#xmmc').val(),id:null},
						  success:function(data){
						   if(data.msg=="-99"){
							     layer.alert('服务器异常', {icon: 5});
							     return false;
						   }else if(data.msg!='0'){
							     layer.alert('申请人名称已经存在请重新输入', {icon: 5});
							     return false;
						   }else{ */
							   /*  var vals =  $('#wyxm').combobox('getValues');
						        $("#wyxm_id").val(vals); */
							    document.Form.action ="${basePath}/df/update?action=2";
								document.Form.submit();
						 /*   }   
						  }
						});	 */
				}
				/* 返回 */
				$("#returnBut").click(function() {
		 			   window.location.href='${basePath}/df/list';
		 		});
				/*  取消 */
				$("#Cancel").click(function() {
					   window.location.href = "${basePath}/df/add";
		 		});
			});
			
			   if("${msg}"!=""){
			       layer.alert("${msg}", {icon: 6});
			  } 
			/* 选择 */
		   function showdiv() {
				$('#div1').dialog('open');
			} 
		   if("${msg}"!=""){
		       layer.alert("${msg}", {icon: 6});
		  }
		</script>
</body>
</html>
